package collection.day04;

import java.util.List;
import java.util.Objects;

/**
 * @Author: Miyako
 * @Date: 2024-07-15-10:18
 * @Description:
 */
public class Rect implements Comparable<Rect> {
    private Integer width;
    private  Integer height;

    Rect(){

    }
    Rect(Integer width, Integer height){
        this.width=width;
        this.height = height;

    }

    /**
     * 根据宽度进行比较，大于返回正数，小于返回负数，等于返回0
     */

    @Override
    public int compareTo(Rect o) {
        return this.width-o.width;
    }

    //    public static <T > void l(List<T super Integer> list){
//
//    }
    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    @Override
    public String toString() {
        return "Rect{" +
                "width=" + width +
                ", height=" + height +
                '}';
    }
}
